<template>
  <div class="Recommend">
    <div class="Rec_box">
      <div
        class="Rec_box_list"
        v-for="(item,index) in type"
        :key='index'
        @click="Recommend_list_click(item.curriculum_id)"
      >
        <div class="Rec_img">
          <img
            :src="item.cover"
            alt=""
          >
        </div>
        <div class="Rec_con">
          <div class="rec_title">{{item.title}}</div>
          <div class="rec_class">{{item.c_title}}</div>
          <!-- <div v-if="item.category == '1'" class="type-typesss">音</div>
          <div v-else-if="item.category == '2'"  class="type-typesss">图</div>
          <div v-else  class="type-typesss">视</div> -->
          <div class="rec_money">{{item.count}} | 课<span><span>¥{{item.money/100}}</span> ¥{{item.preferential_money/100}}</span> </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: ['type'],
  data () {
    return {

    }
  },
  methods: {
    Recommend_list_click (e) {
      // console.log(this.$route.path)
      if (this.$route.path == '/coursedetails') {
        this.$emit('curriculumId', e)
      } else {
        this.$router.push({
          path: '/coursedetails',
          query: {
            curriculumId: e
          }
        })
      }
    }
  }
}
</script>

<style>
.Recommend_box {
  width: 100%;
}
.Rec_box {
  width: 100%;
}
.Rec_box_list {
  display: flex;
  /* margin: 0 0 15px 0; */
  padding-bottom: 15px;
}
.Rec_img {
  width: calc(100vw * 0.36);
  height: calc(100vw * 0.36 * 0.63);
}
.Rec_img > img {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  object-fit: cover;
}
.Rec_con {
  flex: 1;
  padding: 0 15px;
  position: relative;
}
.rec_title {
  text-align: left;
  font-size: 15px;
  font-weight: bold;
  color: #1a1a1a;
  text-overflow: ellipsis;
  display: -webkit-box;
  /* -webkit-box-orient: vertical; */
  /*! autoprefixer: off */
  -webkit-box-orient: vertical;
  /* autoprefixer: on */
  -webkit-line-clamp: 2;
  overflow: hidden;
}
.rec_class {
  width: calc(100% - 30px);
  font-size: 12px;
  color: #999999;
  position: absolute;
  bottom: 19px;
  left: 15px;
}
.type-typesss{
  width: 18px;
  height: 18px;
  background: #F39800;
  color: #fff;
  font-size: 12px;
  text-align: center;
  color: #fff;
  position: absolute;
  right: 14px;
}
.rec_money {
  font-size: 12px;
  width: calc(100% - 30px);
  color: #999999;
  position: absolute;
  bottom: 0;
  left: 15px;
}
.rec_money > span {
  /* position: absolute;
  right: 0;
  top: 0; */
  display: inline-block;
  text-align: right;
  color: #DA4131;
  font-size: 12px;
}
.rec_money > span span {
  position: relative;
  color: #999999;
  font-size: 12px;
}
.rec_money > span span:after {
  position: absolute;
  content: "";
  left: -10%;
  top: 49%;
  width: 120%;
  height: 1px;
  background: #999999;
}
</style>
